package interview;

import java.util.Scanner;

/**
 * @Author: Jun
 * @Date: 2018/8/29 18:27
 */
public class formatDemo {
    public static void main(String[] args) {
        //计算到这个月的多少天
        int allday=0;
        int[] days = {31,28,31,30,31,30,31,31,30,31,30,31};
        Scanner in=new Scanner(System.in);
        final String next = in.next();
        String[] split = next.split(":");
        int year=Integer.parseInt(split[0]);
        int month=Integer.parseInt(split[1]);
        int day=Integer.parseInt(split[2]);

        for (int i=0;i<month-1;i++){
            allday+=days[i];
        }

        allday+=day;

        if(((year % 4==0 && year % 100 == 0)|| year % 400 == 0)&&month > 2){
            allday++;
        }
        System.out.println(month+"月"+day+"是"+year+"年的第"+allday+"天");

    }
}
